<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	String contextPath = request.getContextPath();
%>
<style scoped="scoped">
        .textbox{
            height:20px;
            margin:0;
            pmoding:0 2px;
            box-sizing:content-box;
        }
    </style>
<style type="text/css">
	table tr td{
		align:left;
	}
</style>
<div id="mod_pro" class="easyui-layout" data-options="fit:true">  
    <div data-options="region:'center',split:false" style="padding:30px;">
    	<form id="mod_pro_form" method="post" enctype="MULTIPART/FORM-DATA" multiple="multiple">
    	<input type="hidden" name="id" value="${proInfo.id}">
    	<table align="center">
    		<tr>
    			<td><label for="stu_no">商品编码:</label></td>   
        		<td><input class="easyui-validatebox textbox" readonly="true" data-options="required:true,missingMessage:'请输入商品编码'" name='pro_no' value="${proInfo.pro_no}"/></td>
    		</tr>
    		<tr>
    			<td><label for="customer_no">客户编码:</label></td>  
    			<td><input class="easyui-validatebox textbox" id="pro_cs_no" data-options="required:true,missingMessage:'请输入客户编码'" name='customer_no' value="${proInfo.customer_no}"/></td>
    		</tr>
    		<tr>
    			<td><label for="customer_no">商品名称:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入商品名称'" name='pro_name' value="${proInfo.pro_name}"/></td>
    		</tr>
    		<tr>
    			<td><label for="warehouse">有效仓位:</label></td>  
    			<td>
    				<select class="easyui-combobox" name="warehouse"  id="warehouseId" data-options="required:true,editable:false,missingMessage:'请选择有效仓位',panelHeight:'auto',value:'${proInfo.warehouse}'"style="width:138px">
								<option value="德州仓">德州仓</option>
								<option value="美东MAINE仓">美东MAINE仓</option>
								<option value="芝加哥仓">芝加哥仓</option>
					</select>
    			</td>
    		</tr>
    		<tr>
    			<td><label for="location">区位:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入区位'" name='location' value="${proInfo.location}"/></td>
    		</tr>
    		<tr>
    			<td><label for="loc_no">库位号:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入库位号'"name='loc_no'  value="${proInfo.loc_no}"/></td>
    		</tr>
    		<tr>
			<td>尺寸</td>
			<td colspan="4">长&nbsp;<input type="text" class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入长度'"size="8" name="length" value="${proInfo.length}"/>
				&nbsp;&nbsp;&nbsp;宽
			     &nbsp;<input type="text" size="8" class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入宽度'"name="width" value="${proInfo.width}"/>&nbsp;&nbsp;&nbsp;
			       高&nbsp;<input type="text" size="8" class="easyui-validatebox textbox" data-options="required:true,missingMessage:'请输入高度'"name="height" value="${proInfo.height}"/></td>
			</tr>
    		<tr>
    			<td><label for="weight">重量:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'mone',missingMessage:'请输入重量'"name='weight' value="${proInfo.weight}"/></td>
    		</tr>
    		<tr>
    			<td><label for="pre_postage">预估邮费:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'mone',missingMessage:'请输入预估邮费'"name='pre_postage' value="${proInfo.pre_postage}"/></td>
    		</tr>
    		<tr>
    			<td><label for="pro_number">数量:</label></td>  
    			<td><input class="easyui-validatebox textbox" data-options="required:true,validType:'integer',missingMessage:'请输入数量'"name='pro_number' value="${proInfo.pro_number}"/></td>
    		</tr>
    		<tr>
				<td>图片:</td>
				<td><input class="easyui-filebox" name="file" style="width:170"/></td>
			</tr>
    	</table>
    	</form>
    </div>

	<div data-options="region:'south',split:false" style="height:60px;background:#95B8E7;text-align:center;padding:10px;">
		<a href="javascript:void(0);" onclick="savepro()" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>&nbsp;&nbsp;&nbsp;
		<a href="javascript:void(0);" onclick="cancelpro()" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">取消</a>
	</div> 
</div>  

<script>
$('#pro_cs_no').combobox({    
	url:'admin/system/allCustomerNos.do',    
	valueField:'text',    
	textField:'text',
	required:true,
	panelHeight:'auto'
});
            function savepro(){
            	$('#mod_pro_form').form({    
            	    url:'repertory_manager/subModProInfo.do',    
            	    onSubmit: function(param){    
            	    	var isValid = $(this).form('validate');
            			return isValid;	// 返回false终止表单提交
            	    },    
            	    success:function(data){ 
            	    	var data = eval('(' + data + ')');  
            	    	$.messager.alert('提示',data.msg);
            	    	$("#pro_mod_dialog").dialog('close');
            	    	$("#pro_info_datagrid").datagrid('reload');
            	    }    
            	});    
            	$('#mod_pro_form').submit();  
            }
            /**取消*/
            function cancelpro(){
            	$("#pro_mod_dialog").dialog('close');
            }
</script>